package cn.hongxin.sap.conn.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @author hengji.li@getech.cn
 * @date 2020/2/29
 */
@Data
public class BaseEntity {

    /**
     * 自增主键
     */
    @TableId(value = "id" , type = IdType.AUTO)
    private Long id;

    /**
     * 创建人
     */
    @TableField(value = "create_by" , fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    @ApiModelProperty(hidden = true)
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time" , fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(hidden = true)
    private Date createTime;

    /**
     * 更新人
     */
    @TableField(value = "update_by" , fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(hidden = true)
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_Time" , update = "now()" , fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(hidden = true)
    private Date updateTime;

    /**
     * 备注
     */
    @TableField(value = "remark")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String remark;
}
